<?php if ( ! defined('BASEPATH')) exit("Pas d'acces direct autorisé");
class Membre extends CI_Model{

	public function creation($data){
		$this->db->insert('membre', $data);
	}
	public function supression($id){
		$this->db->where('id', $id);
		$this->db->delete('membre');
	}
	public function modification($data, $id){
		$this->db->set('nom',$data["nom"]);
		$this->db->set('prenom',$data["prenom"]);
		$this->db->set('pseudo',$data["pseudo"]);
		$this->db->set('mail',$data["mail"]);
		$this->db->set('mdp',$data["mdp"]);
		$this->db->where('id', $id);
		$this->db->update('membre');
	}
	public function consultation($id){
		return ($query = $this->db->get_where('membre', array('id' => $id)));
	}
	public function is_known($id){
		$this->db->select('count(id)');
		$this->db->from('membre');
		$this->db->where('id', $id);
		$query = $this->db->get();
		return($query > 0)? true : false;
	}
	

}
